package com.oe.test.controller;
import com.oe.mvc.annotation.*;
import com.oe.test.annotation.Security;
import com.oe.test.service.IDemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@LdmController
@Security("test0")
public class LdmTestController {

    @LdmAutowired
    IDemoService demoService;


    @LdmRequestMapping("/testJson")
    @LdmResponseBody
    public String query(HttpServletRequest request, HttpServletResponse response, String name) {
        demoService.get(name);
        return "authority";
    }

    @LdmRequestMapping("/test1")
    @Security("test1")
    public String test1(HttpServletRequest request, HttpServletResponse response, String name) {
        demoService.get(name);
        return "welcome";
    }

    @LdmRequestMapping("/test2")
    @Security("test2")
    public String test2(HttpServletRequest request, HttpServletResponse response, String name) {
        demoService.get(name);
        return "welcome";
    }

    @LdmRequestMapping("/test3")
    @Security("test3")
    public String test3(HttpServletRequest request, HttpServletResponse response, String name) {
        demoService.get(name);
        return "welcome";
    }


    @LdmRequestMapping("/test4")
    @Security("test4")
    public String test4(HttpServletRequest request, HttpServletResponse response, String name) {
        demoService.get(name);
        return "welcome";
    }
}
